﻿using System.Windows;
using YWM;
using YWM.Session;

namespace Framework.WpfTest
{
    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App : Application
    {
        public App()
        {
            YApp.CreateBuilder().Build<PLCModule>();
            MainWindow window = YApp.Resolve<MainWindow>();
            ISession session = YApp.Resolve<ISession>();
            session.SubjectId = 2;
            A a = YApp.Resolve<A>();
            a.Hello();
        }
    }

    public interface A
    {
        void Hello();
    }

    public class B : A
    {
        private readonly ISession _session;
        public B(ISession session)
        {
            _session = session;
        }
        public void Hello()
        {
            MessageBox.Show("Hello:" + _session.SubjectId);
        }
    }
}
